From: Florian Müllner Date: Sat, 19 Feb 2011 11:21:07 +0000 (+0100) Subject: panel: Adjust CSS for RTL locales X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~8929 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=0a94c01f83fc9be2bd63493dfc100addab1cc627;p=gnome-shell.git panel: Adjust CSS for RTL locales The groups at the panel sides use different left/right padding, so a slightly different CSS is required for RTL locales. Add :rtl pseudo classes as necessary and adjust the CSS. https://bugzilla.gnome.org/show_bug.cgi?id=642697 --- diff --git a/data/theme/gnome-shell.css b/data/theme/gnome-shell.css index 08f636f50..0bd1566b6 100644 --- a/data/theme/gnome-shell.css +++ b/data/theme/gnome-shell.css @@ -196,10 +196,20 @@ StTooltip StLabel { padding-right: 4px; } +#panelLeft:rtl { + padding-right: 0px; + padding-left: 4px; +} + #panelRight { padding-left: 4px; } +#panelRight:rtl { + padding-left: 0px; + padding-right: 4px; +} + #appMenu { spacing: 4px; } diff --git a/js/ui/panel.js b/js/ui/panel.js index 2b315993d..41bb04486 100644 --- a/js/ui/panel.js +++ b/js/ui/panel.js @@ -528,6 +528,13 @@ Panel.prototype = { this._centerBox = new St.BoxLayout({ name: 'panelCenter' }); this._rightBox = new St.BoxLayout({ name: 'panelRight' }); + // This will eventually be automatic, see + // https://bugzilla.gnome.org/show_bug.cgi?id=584662 + if (St.Widget.get_default_direction() == St.TextDirection.RTL) { + this._leftBox.add_style_pseudo_class('rtl'); + this._rightBox.add_style_pseudo_class('rtl'); + } + /* This box container ensures that the centerBox is positioned in the *absolute* * center, but can be pushed aside if necessary. */ this._boxContainer = new Shell.GenericContainer();